<template name="excel">
  <view class="excel-import-wizard">
    <!-- 向导头部 -->
    <view class="wizard-header">
      <view class="header-content">

        <text class="header-title">Excel 数据导入向导</text>
        <text class="header-subtitle">将您的Excel数据导入到系统中</text>
      </view>
    </view>

    <!-- 步骤指示器 -->
    <view class="wizard-steps">
      <view 
        v-for="(step, index) in steps" 
        :key="index"
        :class="['step', { active: currentStep === index + 1, completed: currentStep > index + 1 }]"
      >
        <view class="step-number">{{ index + 1 }}</view>
        <text class="step-title">{{ step.title }}</text>
      </view>
    </view>

    <!-- 步骤内容 -->
    <view class="wizard-content">
      <!-- 步骤1: 选择文件 -->
      <view v-if="currentStep === 1" class="step-content">
        <view 
          class="file-drop-area" 
          @dragover.prevent 
          @drop="handleDrop"
          @click="triggerFileInput"
        >
          <i class="fas fa-cloud-upload-alt file-icon"></i>
          <text class="drop-text">拖放Excel文件到此处或点击选择文件</text>
          <text class="file-types">支持格式: .xlsx </text>
        </view>
        
        <view v-if="selectedFile" class="file-info">
          <view class="info-item">
            <i class="fas fa-file-excel"></i>
            <text class="file-name">已选择了文件：{{ selectedFile.name }}</text>
          </view>
        </view>
      </view>

      <!-- 步骤2: 设置选项 -->
      <view v-if="currentStep === 2" class="step-content">
        <view class="form-group">
          <text class="form-label">起始行</text>
          <input 
            type="number" 
            class="form-control" 
            v-model="startRow" 
            min="1"
            placeholder="请输入起始行号"
          />
        </view>
        
        <view class="form-group">
          <text class="form-label">导入模式</text>
          <view class="radio-group">
            <label class="radio-item">
              <radio 
                value="append" 
                :checked="importMode === 'append'" 
                @click="importMode = 'append'"
                color="#0f66e0"
              />
              <text>追加数据</text>
            </label>
            <label class="radio-item">
              <radio 
                value="replace" 
                :checked="importMode === 'replace'" 
                @click="importMode = 'replace'"
                color="#0f66e0"
              />
              <text>替换数据</text>
            </label>
          </view>
        </view>
        
        <view class="form-group">
          <text class="form-label">数据预览</text>
          <view class="preview-table">
            <scroll-view scroll-x="true" class="preview-scroll">
              <view class="preview-row header-row">
                <view 
                  v-for="(col, index) in excelFields" 
                  :key="index" 
                  class="preview-cell header-cell"
                >
                  {{ col }}
                </view>
              </view>
              <view 
                v-for="(row, rowIndex) in previewData" 
                :key="rowIndex" 
                class="preview-row"
              >
                <view 
                  v-for="(field, cellIndex) in excelFields" 
                  :key="cellIndex" 
                  class="preview-cell"
                >
                  {{ row[field] }}
                </view>
              </view>
            </scroll-view>
          </view>
        </view>
      </view>

      <!-- 步骤3: 字段映射 -->
      <view v-if="currentStep === 3" class="step-content">
        <view class="mapping-instruction">
          <text class="instruction-text">请将Excel字段映射到系统字段，不存在的字段可以留空</text>
        </view>
        
        <view class="mapping-container">
          <view 
            v-for="sysField in systemFields[uploadTypeName]" 
            :key="sysField.value" 
            class="mapping-item"
          >
            <text class="system-field" :class="fieldMappings[sysField.value] ? 'success':'system-field'">{{ sysField.name }}</text>
            <view class="mapping-arrow">
              <i class="fas fa-long-arrow-alt-right"></i>
            </view>
            <picker 
              class="excel-field-picker" 
              :range="excelFields" 
              @change="(e) => onFieldMappingChange(sysField.value, e)"
              :value="fieldMappings[sysField.value] ? excelFields.indexOf(fieldMappings[sysField.value]) : -1"
            >
              <view class="picker-content">
                {{ fieldMappings[sysField.value] || '选择Excel字段' }}
                <i class="fas fa-chevron-down picker-icon"></i>
              </view>
            </picker>
          </view>
        </view>
      </view>

      <!-- 步骤4: 导入数据 -->
      <view v-if="currentStep === 4" class="step-content">
        <view class="import-summary">
          <text class="summary-title">导入摘要</text>
          <view class="summary-grid">
            <view class="summary-item">
              <text class="item-label">文件:</text>
              <text class="item-value">{{ selectedFile.name }}</text>
            </view>
            <view class="summary-item">
              <text class="item-label">起始行:</text>
              <text class="item-value">{{ startRow }}</text>
            </view>
            <view class="summary-item">
              <text class="item-label">导入模式:</text>
              <text class="item-value">{{ importMode === 'append' ? '追加数据' : '替换数据' }}</text>
            </view>
            <view class="summary-item">
              <text class="item-label">总记录数:</text>
              <text class="item-value">{{ filteredData.length }}</text>
            </view>
          </view>
        </view>
        <text class="tipmsg">
			导入过程中不能中断或退出或刷新网页
		</text>
        <view class="progress-container">
          <view class="progress-bar" :style="{ width: progress + '%' }"></view>
          <text class="progress-text">{{ progress }}%</text>
        </view>
        
        <view v-if="importResult" class="import-result">
          <view :class="['result-header', importResult.success ? 'success' : 'error']">
            <i :class="['result-icon', importResult.success ? 'fas fa-check-circle' : 'fas fa-exclamation-circle']"></i>
            <text class="result-title">{{ importResult.success ? '导入成功!' : '导入失败!' }}</text>
          </view>
          <view class="result-details">
            <text v-if="importResult.success" class="result-text">
              成功导入 {{ importResult.importedCount }} 条记录
            </text>
            <text v-if="importResult.error" class="result-text error-text">
              {{ importResult.error }}
            </text>
          </view>
        </view>
      </view>
    </view>

    <!-- 向导操作按钮 -->
    <view class="wizard-actions">
      <button 
        class="action-btn secondary-btn" 
        :disabled="currentStep === 1" 
        @click="prevStep"
      >
        <i class="fas fa-arrow-left"></i>
        上一步
      </button>
      
      <button 
        class="action-btn primary-btn" 
        v-if="currentStep < 4" 
        :disabled="!canProceed"
        @click="nextStep"
      >
        下一步
        <i class="fas fa-arrow-right"></i>
      </button>
      
      <button 
        class="action-btn primary-btn" 
        v-if="currentStep === 4" 
        :disabled="isImporting"
        @click="startImport"
      >
        <i v-if="isImporting" class="fas fa-spinner fa-spin"></i>
        {{ isImporting ? '导入中...' : '开始导入' }}
      </button>
    </view>
  </view>
</template>

<script>
import m_excel from '@/uni_modules/m-excel/m-excel/js_sdk/index.js';

export default {
  data() {
    return {
      currentStep: 1,
      steps: [
        { title: '选择文件' },
        { title: '设置选项' },
        { title: '字段映射' },
        { title: '导入数据' }
      ],
      selectedFile: null,
      startRow: 1,
      importMode: 'append',
      excelData: [], // 从Excel读取的完整数据
      excelFields: [], // Excel中的字段列表

	  systemFields:{
		  goods_add:[
				{name: '分类', value: 'header', default: ''},
				{name: '目录', value: 'directory', default: ''},
				
				{name: '商品名称', value: 'name', default: ''},
				{name: '所属供货商', value: 'gonghuo', default: ''},
				{name: '所属品牌', value: 'brand', default: ''},
				{name: '商品介绍', value: 'content', default: ''},
				
				{name: '裸货价', value: 'bare_money', default: ''},
				{name: '进货价', value: 'jinhuojia', default: ''},
				{name: '最低售价', value: 'allow', default: ''},
				
				{name: '批发价', value: 'pifajia', default: ''},
				{name: '零售价', value: 'petail_price', default: ''},
				{name: 'VIP1价格', value: 'level1', default: '-1'},
				{name: 'VIP2价格', value: 'level2', default: '-1'},
				{name: 'VIP3价格', value: 'level3', default: '-1'},
				{name: 'VIP4价格', value: 'level4', default: '-1'},
				{name: 'VIP5价格', value: 'level5', default: '-1'},
				
				{name: '实时库存数量', value: 'stockcount', default: '0'},
				{name: '库存下限', value: 'margin_start', default: '5'},
				{name: '库存上限', value: 'margin_end', default: '30'},
				{name: '货位号', value: 'position', default: ''},
				{name: '个体单位', value: 'units', default: '个'},
				{name: '整件单位', value: 'units_sumName', default: '件'},
				{name: '整件数量', value: 'units_count', default: '1'},
				
				{name: '备注', value: 'descr', default: ''},
		  ],
		  user_add:[
				{name: '账号名称', value: 'name', default: ''},
				{name: '真实姓名', value: 'nickname', default: ''},
				{name: '联系号码', value: 'phone', default: ''},
				{name: '地址', value: 'city', default: ''},
				{name: '备注', value: 'descr', default: ''},
		  ],
	  },
      fieldMappings: {},
      previewData: [], // 预览数据
      progress: 0,
      isImporting: false,
      importResult: null
    };
  },
  computed: {
    canProceed() {
      switch (this.currentStep) {
        case 1:
          return !!this.selectedFile;
        case 2:
          return this.excelData.length > 0;
        case 3:
          return true; // 字段映射不再强制要求完成
        default:
          return true;
      }
    },
    // 根据起始行过滤数据
    filteredData() {
      return this.excelData.slice(this.startRow - 1);
    }
  },
  
  props: {
  	uploadTypeName:{ // 上传类
  		type: String,
  		default: 'goods_add'
  	},
  	uploadBodyPush:{ // 上传类追加的参数
		type: Object,
		default: () => {
			return {}
		}
  	},
  },
  methods: {
    // 触发文件选择
    triggerFileInput() {

		
      m_excel.read().then(result => {
        if (result.success) {
          // 获取选择的文件信息
          const platform = uni.getSystemInfoSync().uniPlatform;
          const file = platform === 'mp-weixin' 
            ? { name: '微信小程序文件', size: 0 } 
            : { name: '网页文件', size: 0 };
          
          this.selectedFile = file;
          this.processExcelData(result.data);
        } else {
          uni.showToast({
            title: result.msg || '文件选择失败',
            icon: 'none'
          });
        }
		uni.hideLoading({
			fail: function (e) {},
		});
      });
    },
    
    // 处理文件拖放
    async handleDrop(event) {
      event.preventDefault();
      
      // 在H5环境中处理拖放
      if (uni.getSystemInfoSync().platform === 'h5') {
        const file = event.dataTransfer.files[0];
        if (file && this.isExcelFile(file)) {
          this.selectedFile = file;
          await this.readExcelFile(file);
        }
      }
    },
    
    // 使用您提供的m_excel模块读取文件
    async readExcelFile(file) {
      return new Promise((resolve) => {
        m_excel.read_file(file, (result) => {
          if (result.success) {
            this.selectedFile = file;
            this.processExcelData(result.data);
            resolve(true);
          } else {
            uni.showToast({
              title: result.msg || '文件读取失败',
              icon: 'none'
            });
            resolve(false);
          }
        });
      });
    },
    
    // 处理Excel数据
    processExcelData(data) {
      // 保存完整数据
      this.excelData = data;
      
      // 提取字段列表
      if (data.length > 0) {
        this.excelFields = Object.keys(data[0]);
      }
      
      // 初始化字段映射
      this.initFieldMappings();
      
      // 设置预览数据
      this.previewData = data.slice(0, 5);
    },
    
    // 检查是否为Excel文件
    isExcelFile(file) {
      const types = [
        'application/vnd.ms-excel',
        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        'application/vnd.ms-excel.sheet.macroEnabled.12',
        'text/csv'
      ];
      return types.includes(file.type) || 
             file.name.endsWith('.xls') || 
             file.name.endsWith('.xlsx') ||
             file.name.endsWith('.csv') ||
             file.name.endsWith('.xlsm');
    },
    
    // 初始化字段映射
    initFieldMappings() {
      const mappings = {};
      this.systemFields[this.uploadTypeName].forEach(sysField => {
        mappings[sysField.value] = '';
      });
      this.fieldMappings = mappings;
    },
    
    // 字段映射变更处理
    onFieldMappingChange(sysFieldValue, e) {
      const value = e.detail.value;
      if (value >= 0 && value < this.excelFields.length) {
        this.$set(this.fieldMappings, sysFieldValue, this.excelFields[value]);
      } else {
        this.$set(this.fieldMappings, sysFieldValue, '');
      }
    },
    
    // 格式化文件大小
    formatFileSize(bytes) {
      if (bytes === 0) return '0 Bytes';
      const k = 1024;
      const sizes = ['Bytes', 'KB', 'MB', 'GB'];
      const i = Math.floor(Math.log(bytes) / Math.log(k));
      return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
    },
    
    // 上一步
    prevStep() {
      if (this.currentStep > 1) {
        this.currentStep--;
      }
    },
    
    // 下一步
    nextStep() {
      if (this.canProceed) {
        this.currentStep++;
        
        // 进入第三步时初始化字段映射
        if (this.currentStep === 3 && this.excelFields.length > 0) {
          this.initFieldMappings();
        }
      }
    },
    
	
	// 开始导入
	async startImport() {
	  this.isImporting = true;
	  this.progress = 0;
	  this.importResult = null;
	  
	  
	  try {
		//准备上传类名
		const type = this.uploadTypeName
	    // 1. 应用起始行过滤
	    const importData = this.filteredData;
	    
	    // 2. 应用字段映射和默认值处理
	    const mappedData = importData.map(item => {
	      const mappedItem = {};
	      for (const sysField of this.systemFields[this.uploadTypeName]) {
	        const excelField = this.fieldMappings[sysField.value];
	        
	        // 如果用户选择了Excel字段
	        if (excelField) {
	          // 使用Excel中的值（即使为空）
	          mappedItem[sysField.value] = item[excelField];
	        } 
	        // 如果用户没有选择Excel字段
	        else {
	          // 使用默认值
	          mappedItem[sysField.value] = sysField.default;
	        }
	      }
	      return mappedItem;
	    });
	    

	    
	    // 3. 上传数据
	    const totalRecords = mappedData.length;
	    let importedCount = 0;
	    let successCount = 0;
	    let errors = [];
	    
	    // 上传数据
	    for (const record of mappedData) {
	      try {
	        // 准备上传数据
	        const body = {
	          type: type,
			  ...this.uploadBodyPush,
	          ...record // 将映射后的记录展开
	        };
	        
	        // 调用上传方法
	        const response = await this.uploadRecord(body);
	        
	        // 检查上传结果
	        if (response.code === 0) {
	          successCount++;
	        } else {
	          errors.push({
	            record,
	            error: response.msg || '上传失败'
	          });
	        }
	      } catch (error) {
	        errors.push({
	          record,
	          error: error.message || '上传过程中发生错误'
	        });
	      }
	      
	      // 更新进度
	      importedCount++;
	      this.progress = Math.round((importedCount / totalRecords) * 100);
	    }
	    
	    // 导入完成
	    this.isImporting = false;
	    
	    if (errors.length === 0) {
	      // 全部成功
	      this.importResult = {
	        success: true,
	        importedCount: successCount,
	        data: mappedData
	      };
	      
	      uni.showToast({
	        title: `成功导入 ${successCount} 条记录`,
	        icon: 'success'
	      });
	    } else {
	      // 部分成功
	      this.importResult = {
	        success: false,
	        importedCount: successCount,
	        errorCount: errors.length,
	        errors: errors,
	        error: `成功导入 ${successCount} 条，失败 ${errors.length} 条`
	      };
	      
	      uni.showToast({
	        title: `导入完成：成功 ${successCount} 条，失败 ${errors.length} 条`,
	        icon: 'none'
	      });
	    }
	    
	  } catch (error) {
	    console.error('导入过程中发生错误:', error);
	    this.isImporting = false;
	    this.importResult = {
	      success: false,
	      error: error.message || '导入过程中发生未知错误'
	    };
	    
	    uni.showToast({
	      title: '导入失败',
	      icon: 'none'
	    });
	  }
	},
	
	// 上传单条记录
	uploadRecord(body) {
	  return new Promise((resolve, reject) => {
	    this.$common.get_request(
	      body,
	      (res) => {
	        // 上传成功后的回调
	        resolve(res);
	      },
	      (res) => {
	        // 上传完成后的回调（无论成功失败）
	        resolve(res);
	      }
	    );
	  });
	}

  }
};
</script>


<style lang="scss" scoped>
/* 主色调 */
$primary-color: #0f66e0;
$primary-light: rgba(15, 102, 224, 0.1);
$primary-dark: #0a55b8;

/* 辅助色 */
$success-color: #28a745;
$error-color: #dc3545;
$warning-color: #ffc107;
$gray-light: #f8f9fa;
$gray-medium: #e9ecef;
$gray-dark: #6c757d;
$text-color: #212529;

/* 向导容器 */
.excel-import-wizard {
  width: 100%;
  // max-width: 900px;
  // margin: 20px auto;
  background: white;
  // border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 头部样式 */
.wizard-header {
  background: $primary-color;
  color: white;
  padding: 0px 30px 10px 30px;
  
  .header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  

  
  .header-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  .header-subtitle {
    font-size: 16px;
    opacity: 0.9;
  }
}

/* 步骤指示器 */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  background-color: $gray-light;
  position: relative;
  
  &::before {
    content: '';
    position: absolute;
    top: 35px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: $gray-medium;
    z-index: 1;
  }
  
  .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    
    &.active, &.completed {
      .step-number {
        background: $primary-color;
        color: white;
        // border-color: $极狐-color;
      }
      
      .step-title {
        color: $primary-color;
        font-weight: 600;
      }
    }
    
    &.completed .step-number::after {
      content: '✓';
      position: absolute;
      font-size: 18px;
    }
  }
  
  .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: $gray-dark;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    border: 2px solid $gray-medium;
    transition: all 0.3s ease;
  }
  
  .step-title {
    font-size: 14px;
    color: $gray-dark;
    text-align: center;
    transition: color 0.3s ease;
  }
}

/* 步骤内容 */
.wizard-content {
  padding: 30px;
  margin-bottom: 120px;
}

.step-content {
  min-height: 400px;
}

/* 文件拖放区域 */
.file-drop-area {
  border: 2px dashed $primary-color;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: $primary-light;
  
  &:hover {
    background: rgba(15, 102, 224, 0.15);
  }
  
  .file-icon {
    font-size: 56px;
    color: $primary-color;
    margin-bottom: 20px;
  }
  
  .drop-text {
    display: block;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
    color: $text-color;
  }
  
  .file-types {
    font-size: 14px;
    color: $gray-dark;
  }
}

/* 文件信息 */
.file-info {
  margin-top: 25px;
  padding: 15px;
  background: $gray-light;
  border-radius: 8px;
  border-left: 4px solid $primary-color;
  
  .info-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 15px;
    
    &:last-child {
      margin-bottom: 0;
    }
    
    i {
      width: 24px;
      color: $primary-color;
      margin-right: 10px;
    }
    
    .file-name {
      font-weight: 500;
    }
  }
}

/* 表单组 */
.form-group {
  margin-bottom: 25px;
  
  .form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: $text-color;
    font-size: 16px;
  }
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  background: white;
  transition: border-color 0.3s;
  
  &:focus {
    border-color: $primary-color;
    outline: none;
  }
}

.picker-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  
  .picker-icon {
    color: $gray-dark;
  }
}

/* 单选按钮组 */
.radio-group {
  display: flex;
  gap: 25px;
  
  .radio-item {
    display: flex;
    align-items: center;
    font-size: 15px;
    
    radio {
      transform: scale(1.1);
      margin-right: 8px;
    }
  }
}

/* 预览表格 */
.preview-table {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.preview-scroll {
  max-height: 250px;
  overflow: auto;
}

.preview-row {
  display: flex;
  
  &.header-row {
    background: $primary-light;
    font-weight: 600;
  }
  
  &:not(:last-child) {
    border-bottom: 1px solid #eee;
  }
}

.preview-cell {
  padding: 12px 15px;
  min-width: 120px;
  flex: 1;
  border-right: 1px solid #eee;
  
  &:last-child {
    border-right: none;
  }
  
  &.header-cell {
    background: $primary-light;
    color: $primary-color;
  }
}

/* 字段映射 */
.mapping-instruction {
  background: #f8f9fa;
  border-left: 4px solid $primary-color;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 4px;
  
  .instruction-text {
    color: $gray-dark;
    font-size: 14px;
  }
}

.mapping-container {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.mapping-item {
  display: flex;
  align-items: center;
  padding: 15px 10px;
  border-bottom: 1px solid #eee;
  
  &:last-child {
    border-bottom: none;
  }
}

.system-field {
  flex: 1;
  font-weight: 500;
  padding: 8px 12px;
  background: $gray-light;
  border-radius: 6px;
}

.mapping-arrow {
  width: 40px;
  text-align: center;
  color: $primary-color;
  font-size: 18px;
}

.excel-field-picker {
  flex: 1;
}

/* 导入摘要 */
.import-summary {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 25px;
  
  .summary-title {
    display: block;
    padding: 12px 15px;
    background: $primary-light;
    font-weight: 600;
    color: $primary-color;
  }
  
  .summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
  }
  
  .summary-item {
    display: flex;
    
    .item-label {
      font-weight: 600;
      width: 100px;
      color: $gray-dark;
    }
    
    .item-value {
      flex: 1;
      font-weight: 500;
    }
  }
}

/* 进度条 */
.progress-container {
  height: 40px;
  background: $gray-light;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  margin-bottom: 25px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, $primary-color, $primary-dark);
  transition: width 0.5s ease;
}

.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
}

/* 导入结果 */
.import-result {
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
  
  .result-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    
    &.success {
      background: rgba(40, 167, 69, 0.1);
      color: $success-color;
    }
    
    &.error {
      background: rgba(220, 53, 69, 0.1);
      color: $error-color;
    }
  }
  
  .result-icon {
    font-size: 24px;
    margin-right: 12px;
  }
  
  .result-title {
    font-size: 20px;
    font-weight: 600;
  }
  
  .result-details {
    padding: 20px;
    background: white;
  }
  
  .result-text {
    display: block;
    font-size: 16px;
    margin-bottom: 10px;
    
    &.error-text {
      color: $error-color;
    }
  }
}

/* 操作按钮 */
.wizard-actions {
	display: flex;
	justify-content: space-between;
	padding: 20px 30px;
	border-top: 1px solid #eee;
	position: absolute;
	bottom: 0px;
	width: -webkit-fill-available;
	background-color: #fff;
	box-shadow: 1px 0px 5px 1px #333;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  
  i {
    margin: 0 8px;
  }
}
.success{
	background-color: #2ab100;
	color: #fff;
	flex: 1;
	font-weight: 500;
	padding: 8px 12px;
	border-radius: 6px
}
.primary-btn {
  background: $primary-color;
  color: white;
  border: none;
  
  &:hover {
    background: $primary-dark;
  }
  
  &:disabled {
    background: #a0c4ff;
    cursor: not-allowed;
  }
}

.secondary-btn {
  background: white;
  color: $primary-color;
  border: 1px solid $primary-color;
  
  &:hover {
    background: $primary-light;
  }
  
  &:disabled {
    color: #a0c4ff;
    border-color: #a0c4ff;
    cursor: not-allowed;
  }
}
.tipmsg{
	text-align: center;
	padding: 12px 15px;
	display: flex;
	font-weight: 600;
	color: #ff0000;
}
</style>